﻿Imports System.Windows.Forms

Public Class frmArchive
    Public Enum enumArchiveOption
        None
        Project
        Database
        Table
        Selected
        Scheduled
        Validated
        Validated_Selected
    End Enum

    Friend ArchiveOption As enumArchiveOption = enumArchiveOption.None

    Private Sub Cancel_Button_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Cancel_Button.Click
        ArchiveOption = enumArchiveOption.None
        Me.Close()
    End Sub

    Private Sub lnkProject_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lnkProject.Click
        ArchiveOption = enumArchiveOption.Project
        Me.Close()
    End Sub

    Private Sub lnkDatabase_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lnkDatabase.Click
        ArchiveOption = enumArchiveOption.Database
        Me.Close()
    End Sub

    Private Sub lnkTable_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lnkTable.Click
        ArchiveOption = enumArchiveOption.Table
        Me.Close()
    End Sub

    Private Sub lnkSelected_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lnkSelected.Click
        ArchiveOption = enumArchiveOption.Selected
        Me.Close()
    End Sub

    Private Sub lnkValidated_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lnkValidated.Click
        ArchiveOption = enumArchiveOption.Validated
        Me.Close()
    End Sub

    Private Sub lnkScheduled_Click(sender As Object, e As System.EventArgs) Handles lnkScheduled.Click
        ArchiveOption = enumArchiveOption.Scheduled
        Me.Close()
    End Sub

    Private Sub frmArchive_Load(sender As Object, e As System.EventArgs) Handles Me.Load
        Dim Reason As String = ""
        If Not MainForm.IsSelectionCurrent(, Reason) Then
            lnkSelected.Enabled = False
            lblSelected.Text = "Unable to archive selected because: " & Reason
        End If
        If ActiveTableType() <> clsProject.enumTableTypes.Working Then lnkValidated.Enabled = False
    End Sub

End Class
